package com.tianhui.consignortwofei.pattern.orderOprate.impl;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import com.fgs.common.utils.ToastUtil;
import com.tianhui.consignortwofei.constant.KeyValue;
import com.tianhui.consignortwofei.mvp.model.enty.OrderOperateInfo;
import com.tianhui.consignortwofei.mvp.ui.activity.VehicleTrajectoryActivity;
import com.tianhui.consignortwofei.pattern.orderOprate.IOrderOperate;

/**
 * @author fgs
 * @date 2020/9/27
 * @description 车辆轨迹
 **/
public class VehicleTrajectoryOperate implements IOrderOperate {
    @Override
    public void orderOperate(Context context, OrderOperateInfo operateInfo) {
        if (operateInfo != null && operateInfo.orderInfo != null) {
            if (operateInfo.orderInfo.isstate == 7 || operateInfo.orderInfo.isstate == 9 || operateInfo.orderInfo.isstate > 11) {
                Intent intent = new Intent(context, VehicleTrajectoryActivity.class);
                Bundle bundle = new Bundle();
                bundle.putParcelable(KeyValue.KEY_ORDER_INFO, operateInfo.orderInfo);
                intent.putExtras(bundle);
                context.startActivity(intent);
            } else {
                ToastUtil.showShortToast("该订单无车辆轨迹信息");
            }
        } else {
            ToastUtil.showShortToast("获取订单信息失败");
        }

    }
}
